package enumandlambda;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author shkstart
 * @create 2022-12-08-14:46
 */
public class ThreadPoolDemo8 {
    public static void main(String[] args) {

        //根据当前的设别的配置自动生成线程池
        ExecutorService service = Executors.newWorkStealingPool();
        for (int i = 0; i < 100; i++) {
            service.submit(()->{
                System.out.println("线程名" + Thread.currentThread().getName());
            });
        }
        while(!service.isTerminated()){

        }
    }
}
